package com.mdp.im.core.service.admin;
public class TestConvert {
 
	// 将字母转换成数字_1
	public static String t1(String input) {
		String reg = "[a-zA-Z]";
		StringBuffer strBuf = new StringBuffer();
		input = input.toLowerCase();
		if (null != input && !"".equals(input)) {
			for (char c : input.toCharArray()) {
				if (String.valueOf(c).matches(reg)) {
					strBuf.append(c - 96);
				} else {
					strBuf.append(c);
				}
			}
			return strBuf.toString();
		} else {
			return input;
		}
	}
 
	// 将字母转换成数字
	public static void letterToNum(String input) {
		for (byte b : input.getBytes()) {
			System.out.print(b - 96);
		}
	}
 
	// 将数字转换成字母
	public static void numToLetter(String input) {
		for (byte b : input.getBytes()) {
			System.out.print((char) (b + 48));
		}
	}
 
	/**
	 123456782011144444444
	abcdefhhggfgghhgggchchhchcgcg-1008887424
	-1008887424
	-1008887424
	2018699554
	1311053135
	 */
	/**
	 * 
	 * @param args
	 */
	
	
	public static void main(String[] args) {
		String i0 = "abcdefghtaaadddddddd1";
		String i1 = "abcdefghtaaadddddddd";
		String i2 = "12345688776778877738388383737";
		letterToNum(i1);
		System.out.println();
		numToLetter(i2);
		
		String a1="aaaabbbbcccc";
		String a2="aaaabbbbcccc";
		String a3=new String("aaaabbbbcccc");
		
		TestConvert t=new TestConvert();
		
		TestConvert t2=new TestConvert();
		
		System.out.println(a1.hashCode());
		System.out.println(a2.hashCode());
		System.out.println(a3.hashCode());
		
		System.out.println(t.hashCode());
		System.out.println(t2.hashCode());
	}
}
